package cn.edu.zafu.bigdata.lhff;

public class DivisionExample{
    public static int divide(int a,int b){
        if (b == 0){
            throw new ArithmeticException("错误:除数不能为零");
        }
        return a / b;
    }
    public static void main(String[] args){
        try{
            int result = divide(10, 0);
            System.out.println("除法结果是:" + result);
        }catch (ArithmeticException e){
            System.out.println(e.getMessage());
        }
    }
}

